
package trim.testalgorithms;

import trim.*;
import trim.common.result.*;
import trim.common.inputdata.*;
import trim.differentmaterials.core.*;
import trim.differentmaterials.core.initializers.*;
import trim.differentmaterials.coefficients.*;
import trim.differentmaterials.generator.core.*;
import trim.testalgorithms.optresttrim.ErnmOptimalRestTrimmer;

/**
 *
 * @author Podorov Alexander
 */

public class ErnmOpt extends Trim
{
    public TrimResult solve(InputData inputData) throws NoSolutionsException
    {
        TrimCore core = new TrimCore(inputData);
        Coefficients coefficients = new ErnmCoefficients();
        core.setInitializer(new ErlmErnmTrimCoreInitializer(core, coefficients));
        Generator generator = new Generator(core, coefficients);
        core.setGenerator(generator);
        core.startSymplexMethod();
        core.normalizePatterns();
        core.setRestTrimmer(new ErnmOptimalRestTrimmer(core, generator, coefficients));
        //core.comparePatterns();
        return core.getTrimResult();
    }

    public String getName()
    {
        return "ERNM-OPT (Exact requires, near materials)";
    }

    public String getVersion()
    {
        return "1.0.0";
    }

    public String getDescription()
    {
        return "Раскрой заданного вектора требований из не более чем заданного количества материалов";
    }
}
